package org.space.galaxyCabinet.controller;

import org.space.galaxyCabinet.clients.RabbitMQOrderClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RestController
@RequestMapping("/mq")
@CrossOrigin(origins = "*")
public class MQController {

    @Autowired
    private RabbitMQOrderClient rabbitMQOrderClient;

    @GetMapping("/send")
    public String send(@RequestParam("message") String message) {
        rabbitMQOrderClient.sendMessage(message);
        return message;
    }
}
